//
//  UserSecurityController.m
//  BShop
//
//  Created by chenguibang on 2017/8/10.
//  Copyright © 2017年 chenguibang. All rights reserved.
//

#import "UserSecurityController.h"

@interface UserSecurityController (){
    NSArray *menus;
}

@end

@implementation UserSecurityController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self setupView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}




- (void)setupView{
    self.title = @"账号安全";
    
    
    //    self.tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    //    [self.view addSubview:self.tableView];
    //    self.tableView.delegate = self;
    //    self.tableView.dataSource = self;
    //     [_tableView setContentOffset:CGPointMake(CGFLOAT_MAX, CGFLOAT_MAX)];
    
    
    
    
    
    
    
    menus = @[
              @[
                  @{
                      @"title":@"B商城账号",
                      @"content":@"3654265456",
                      @"img":@"cancle"
                      },
                  ],
              
              @[
                  
                  @{
                      @"title":@"手机",
                      @"content":@"13878677428",
                      @"img":@""
                      },
                  @{
                      @"title":@"邮箱",
                      @"content":@"735356384@qq.com",
                      @"img":@""
                      
                      },
                  ],
              
              @[
                  @{
                      @"title":@"QQ",
                      @"content":@"735356384",
                      @"img":@""
                      
                      },
                  
                  @{
                      @"title":@"微信",
                      @"content":@"735356384",
                      @"img":@""
                      
                      },
                  
                  @{
                      @"title":@"新浪微博",
                      @"content":@"13878677428",
                      @"img":@""
                      
                      },
                  ],
              @[
                  @{
                      @"title":@"修改密码",
                      @"content":@"",
                      @"img":@""
                      
                      },
                  ]
              
            
              ];
    
}


#pragma mark - UITableView_DataSource


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return menus.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return [menus[section] count];
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
        cell.textLabel.font = [UIFont systemFontOfSize:14];
        cell.detailTextLabel.font = [UIFont systemFontOfSize:14];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    cell.textLabel.text = menus[indexPath.section][indexPath.row][@"title"];
    cell.detailTextLabel.text = menus[indexPath.section][indexPath.row][@"content"];
    return cell;
}

#pragma mark - UITableView_Delegate
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    NSString *title = menus[indexPath.section][indexPath.row][@"title"];

    
}





- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 0.01;
}


- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 10;
}






/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
